﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Content.Master" Inherits="System.Web.Mvc.ViewPage<MethodWorx.CMS.UI.Areas.Administration.Models.PluginsModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MethodWorx CMS - Plugins
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script language="javascript">
        $(document).ready(function () {
            $(".exceptionInfo").tooltip({ showURL: false, showBody: " - " });
        });
    </script>

    <h2>Plugins</h2>
     <div class="formItem">
        <em>
            Below is a list of plugins that are present on this CMS installation.  Any hosted/integrated application using this CMS platform should also contain the same plugins to enable
            all available features.
        </em>
    </div>
    <h3>Safe Loaded Plugins</h3>
    <table class="table">
        <thead>
            <tr>
            <td><strong>Plugin Name</strong></td>
            <td><strong>Plugin Description</strong></td>
            </tr>
        </thead>
        <tbody>
        <%if (this.Model.SafePlugins.Count() == 0)
          { %>
            <tr><td colspan="2" align="center"><em>No safe plugins are currently loaded.</em></td></tr>
        <%}
          else
          { %>
        <%foreach (var plugin in this.Model.SafePlugins)
          {%>
            <tr>
                <td><%=plugin.Name%></td>
                <td><%=plugin.Description%></td>
            </tr>
        <%}
          }%>
          </tbody>
    </table>

    <h3>Unsafe Plugins</h3>
    <table class="table">
        <thead>
            <tr>
            <td><strong style="color:#FF0084">Plugin Type</strong></td>
            <td><strong style="color:#FF0084">Loading / Execution Exception</strong></td>
            <td></td>
            </tr>
        </thead>
        <tbody>
        <%if (this.Model.UnsafePlugins.Count() == 0)
          { %>
            <tr><td colspan="2" align="center"><em>No plugins are currently flagged as unsafe.</em></td></tr>
        <%}
          else
          { %>
        <%foreach (var plugin in this.Model.UnsafePlugins)
          {%>
            <tr>
                <td><%=plugin.Type.Name%></td>
                <td><%=plugin.Exception.Message%></td>
                <td><img src="<%=Url.Content("~/Images/icons/information.png")%>" class="exceptionInfo" title="<%=plugin.Type.Assembly.GetName()%><br/><%=plugin.Type.FullName %> - <strong><%=plugin.Exception.Message%><strong><br/><%=plugin.Exception.StackTrace.Replace("\r", "<br/>")%>" /></td>
            </tr>
        <%}
          }%>
          </tbody>
    </table>
</asp:Content>
